From c3f3e4a6702cec54b1c835ee0c539a2763674d1b Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 20 May 2011 16:11:41 -0400 Subject: [PATCH] styleproperties: resolve properties of type GTK_TYPE_SHADOW https://bugzilla.gnome.org/show_bug.cgi?id=649314 --- gtk/gtkstyleproperties.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c index 88467ae04e..9358605233 100644 --- a/gtk/gtkstyleproperties.c +++ b/gtk/gtkstyleproperties.c @@ -845,6 +845,29 @@ resolve_gradient (GtkStyleProperties *props, return TRUE; } +static gboolean +resolve_shadow (GtkStyleProperties *props, + GValue *value) +{ + GtkShadow *resolved, *base; + + base = g_value_get_boxed (value); + + if (base == NULL) + return TRUE; + + if (_gtk_shadow_get_resolved (base)) + return TRUE; + + resolved = _gtk_shadow_resolve (base, props); + if (resolved == NULL) + return FALSE; + + g_value_take_boxed (value, resolved); + + return TRUE; +} + static gboolean style_properties_resolve_type (GtkStyleProperties *props, PropertyNode *node, @@ -872,6 +895,11 @@ style_properties_resolve_type (GtkStyleProperties *props, if (!resolve_gradient (props, val)) return FALSE; } + else if (val && G_VALUE_TYPE (val) == GTK_TYPE_SHADOW) + { + if (!resolve_shadow (props, val)) + return FALSE; + } return TRUE; } -- 2.30.2